package org.chen.exception;

import org.chen.service_enum.ErrorCode;

public class CustomException extends RuntimeException {
    private final int code;

    public CustomException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
    }

    public CustomException(int code, String message) {
        super(message);
        this.code = code;
    }

    public int getCode() {
        return code;
    }
}
